/**
 * Created by wkj on 2017/3/23.
 */
import React, { Component } from 'react';
import {
	StyleSheet, View, TouchableOpacity,
} from 'react-native';
import { BoxShadow } from 'react-native-shadow'

class BoxShadowYaGuan extends Component {
  static defaultProps = {
    color: "#999999"
  }

	constructor(props) {
		super(props);
		this.state = {
		};
	}

	_getShadowOpt(data) {
		return {
			width: data.width,
			height: data.height,
			color: this.props.color,
			border: 3,
			radius: 6,
			opacity: 0.1,
			x: 0,
			y: 3,
			style: data.style
		}
	}
	render() {
		const { width, height, renderItem, containerStyle } = this.props;
		let content;
		if (renderItem) {
			content = renderItem();
		}else {
			content= null
		}

		return (
			<BoxShadow setting={this._getShadowOpt({
				width,
				height,
				style: containerStyle
			})}>
				{content}
			</BoxShadow>
		);
	}
}

const styles = StyleSheet.create({
	touchableStyle: {
		flex: 1,
		justifyContent: 'center',
		alignItems: 'center',
		backgroundColor: 'white',
		height: 50,
	},
	container: {
		flex: 1,
		justifyContent: 'center',
		alignItems: 'center',
		flexDirection: 'row',
		backgroundColor: 'white',
	},
});

module.exports = BoxShadowYaGuan;
